package com.rope.backEnd.mapper;

import com.rope.backEnd.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserReVeMapper {
    //验证用户是否存在
    @Select("select name , password , avatar , state , signature from rope_database.user where name=#{userName}")
    User examine(@Param("userName") String userName );


    //将用户注册的到数据库
    @Insert("insert into rope_database.user (name,password,avatar) VALUES (#{user.name},#{user.password},#{user.avatar});")
    int enroll(@Param("user")User user);//返回影响的行数




    @Insert("update rope_database.user set state = 0 WHERE name = #{userName}")
    int state(@Param("userName") String userName);
}
